package ua.util;

public class Util {

	private static Util instance;

	public static Util getInstance() {
		if (instance == null) {
			instance = new Util();
		}
		return instance;
	}

	public static String addString(String string, String addString, String separator) {
		if (string != "") 
		{
			return string + separator + addString;
		}
		return addString;
	}

	public static String removeString(String string, String removeString,String separator) {
		if (string != "") {
			String output = "";
			String[] tab = string.split(separator);
			for (int i = 0; i < tab.length; i++) 
			{
				if (!tab[i].equals(removeString)) 
				{
					output = addString(output, tab[i], separator);
				}
			}
			return output;
		}
		return string;
	}
}
